package com.phuc.game.andPuzzle.sprite;

import org.anddev.andengine.entity.modifier.ParallelEntityModifier;
import org.anddev.andengine.entity.modifier.RotationModifier;
import org.anddev.andengine.entity.modifier.ScaleModifier;
import org.anddev.andengine.entity.sprite.AnimatedSprite;
import org.anddev.andengine.util.constants.TimeConstants;
import org.anddev.andengine.util.modifier.ease.IEaseFunction;

import android.util.Log;

import com.phuc.game.andPuzzle.engine.GamePlay;

public class PuzzleFinish extends AnimatedSprite implements TimeConstants {

	public static final int SIZE_W = 420;
	public static final int SIZE_H = 525;
	
	public PuzzleFinish() {
		super(0, 90, SIZE_W, SIZE_H,
				GamePlay.textureImageBig.getFaceTiledTextureRegion());
		startFly();
	}
	
	public void startFly() {
		Log.d("PhucpHUc", "phucphuc fly iun");
		
		RotationModifier rotation = new RotationModifier(2, 0, 360);
		ScaleModifier scale = new ScaleModifier(2, 0, 1, new IEaseFunction() {
			@Override
			public float getPercentage(float pSecondsElapsed, float pDuration) {
				return pSecondsElapsed / pDuration;
			}
		});
		
		this.registerEntityModifier(
				new ParallelEntityModifier(rotation, scale));
	}
	
	
	
}
